Skip to content

feat: additional --preview-interval values - #1915

Merged
leejet merged 7 commits into
leejet:masterfrom
vmobilis:master
Aug 30, 2026
Merged

feat: additional --preview-interval values#1915
leejet merged 7 commits into
leejet:masterfrom
vmobilis:master

Conversation

@vmobilis

@vmobilis vmobilis commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Summary

Additional values for --preview-interval option of sd-cli:

  • value 0 should preview only the last step of base-resolution sampling.
    Can be used in --hires generations to save (in --preview-path) the base-resolution result together with the high-resolution final image, skipping simultaneous high-resolution sampling + decoding.
    With feat: support numbering for preview images #1895, can save all base-resolution results of batch generations.
  • values less than 0 should decode only the -Nth single image (to preview a sample and not to slow the generation down).

Additional Information

For example, --steps 20 --hires --preview-interval 20 and --steps 20 --hires --preview-interval 0 make identical "base + high" images, but with less memory.
Peak memory usage (SD 1.5, 256×512 -> 448×896, CPU):

--preview--preview-interval 0--preview-interval 20
tae3.03 Gb3.72 Gb
vae3.12 Gb4.33 Gb

Also, I have enabled "last step" preview for "high noise" video pass, but I didn't test any video generations and not sure if this is much useful.

The sd-server should be unaffected because it doesn't set the preview interval and uses default "every step" value.

Checklist

@leejet
leejet merged commit d9b6e27 into leejet:master Aug 30, 2026
9 checks passed
@vmobilis

vmobilis commented Sep 1, 2026

Copy link
Copy Markdown
Contributor Author

@leejet, could you please explain? If I uderstood correctly, in d9b6e27/src/runtime/preview_interval.h:

  • the logical_sample_step(step) is abs(step);
  • the sample_step_is_complete() is step > 0 || (terminal_sigma_is_zero && abs(step) == total_steps)
    (Because step == 0total_steps > 0).

So the logic is same, except the case when step < 0.
When is it negative, I didn't find it?

Got it, I forgot samplers with 2 denoising passes, like "auto denoised_opt = model(x, sigmas[i], -(i + 1));".
Thank you very much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants